package com.leizi.igym.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.leizi.igym.domain.Post;
import com.leizi.igym.dto.*;
import com.leizi.igym.vo.PostVO;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.util.List;

/**
* @author PC
* @description 针对表【t_post】的数据库操作Service
* @createDate 2024-04-29 16:24:50
*/
public interface PostService extends IService<Post> {

    PostVO getByIdWithUserInfo(Long id);

    boolean add(PostAddDTO dto);

    boolean updateAndToES(PostDTO dto);

    boolean deleteWithES(Long id);

    List<PostVO> getBySearch(PostSearchDTO dto) throws IOException;

    List<PostVO> get(Long current,Long pageSize);

    boolean doLike(Long id, PostLikeDTO dto);

    @Transactional
    boolean doCollect(Long id, PostCollectDTO dto);

    List<PostVO> getMy(Long userId);

    Integer likeCount(Long userId);

    Integer collectCount(Long userId);
}
